#include "StdAfx.h"
#include "ReadSqlite.h"

ReadSqlite::ReadSqlite(void)
{


}

//---------------------------------------------------------------------------------------

void ReadSqlite::SetWidthFields(array<unsigned int >^ width){
	G_widthFields->Resize( G_widthFields, width->Length);
	System::Array::Copy(width, G_widthFields, width->Length);
	int i = G_grid->ColumnCount;
	for(int i=0; i <  G_widthFields->Length; i++)
		G_grid->Columns[i]->Width = G_widthFields[i];
}

//---------------------------------------------------------------------------------------

array<unsigned int >^ ReadSqlite::GetWidthFields(){
	for(int i=0; i <  G_grid->ColumnCount; i++)
		G_widthFields[i] = G_grid->Columns[i]->Width;
	return G_widthFields;
}

//---------------------------------------------------------------------------------------

void ReadSqlite::SetVisibleFields(array<unsigned int>^ fields){
	G_VisibleFields->Resize( G_VisibleFields, fields->Length);
	System::Array::Copy(fields, G_VisibleFields, fields->Length);
	int i = G_grid->ColumnCount;
	for(int i=0; i <  G_VisibleFields->Length; i++)
		G_grid->Columns[i]->Visible = G_VisibleFields[i];


}
//---------------------------------------------------------------------------------------

void ReadSqlite::SetDataGridView(System::Windows::Forms::DataGridView^ grid){
	G_grid = grid;

}

//---------------------------------------------------------------------------------------